package com.seafwg.xml.service.impl;

import com.seafwg.xml.dao.AccountDao;
import com.seafwg.xml.service.AccountService;

/**
 * @Author seafwg
 * @Date 2022/3/13 12:27 上午
 * @Version 1.0
 * @description xxx
 */

public class AccountServiceImpl implements AccountService {
    //注入dao层
    private AccountDao accountDao;
    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }

    /**
     * 实现service层借钱的方法：
     * @param divPerson
     * @param addPerson
     * @param money
     */
    @Override
    public void transfer(String divPerson, String addPerson, double money) {
        accountDao.addAccount(addPerson, money);
        // int i = 100/ 0;
        accountDao.divAccount(divPerson, money);
    }
}
